package com.virus.server.catalina;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Host {

    private List<Context> contexts;

    private String name;

    private String appBase;

    private Map<String, Context> contextMap = new HashMap<>();

    public Host(String name) {
        this.name = name;
    }

    public List<Context> getContexts() {
        return contexts;
    }

    public String getName() {
        return name;
    }

    public String getAppBase() {
        return appBase;
    }

    public void setContexts(List<Context> contexts) {
        this.contexts = contexts;
        for (Context context : contexts) {
            contextMap.put(context.getPath(),context);
        }
    }

    public void setAppBase(String appBase) {
        this.appBase = appBase;
    }

    public Map<String, Context> getContextMap() {
        return contextMap;
    }
}
